{include file='public/header.html'}
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar" id="sidebar">
            {include file='public/sidebar.html'}
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main" id="main">
            <h3 class="page-header">添加文集</h3>

            <div class="panel panel-default">
                <div class="panel-heading">添加文集<span class="pull-right"><a href="javascript:history.back(-1);">返回</a></span></div>
                <div class="panel-body">
                    <form class="form-horizontal submit-ajax" role="form" action="{:url('add')}" method="post">

                        <div class="form-group">
                            <label for="title" class="col-sm-1 control-label">*标题</label>
                            <div class="col-sm-11">
                                <input type="text" id="title" name="title" class="form-control" placeholder="请输入标题" value="" />
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="sign" class="col-sm-1 control-label">*标识</label>
                            <div class="col-sm-11">
                                <input type="text" id="sign" name="sign" class="form-control" placeholder="标识名称(英文)" value="" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">封面</label>
                            <div class="col-sm-11">
                                {php $attr=pic_attr()}
                                <input type="hidden" id="thumb" name="thumb" value="" />
                                <div id="pic_box" class="thumb">
                                    <img id="pic_img" {$attr.img} width="90" height="60" alt="thumb" />上传封面
                                    <span id="pic_remove" {$attr.span}>删除</span>
                                    <input id="upload-input" type="file" accept="image/*" onchange="previewImg(this);">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="summary" class="col-sm-1 control-label">*简介</label>
                            <div class="col-sm-11">
                                <textarea name="summary" id="summary" rows="2" class="form-control" placeholder="请输入文档简介"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="sort" class="col-sm-1 control-label">*排序</label>
                            <div class="col-sm-11">
                                <input type="text" id="sort" name="sort" class="form-control" style="width:auto;" placeholder="请输入排序值" value="50" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">*类型</label>
                            <div class="col-sm-11">
                                {:form_select('is_public', ['私有', '公开'], 1, ' class="form-control" style="width:auto;"')}
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-1 control-label">&nbsp;</label>
                            <div class="col-sm-11">
                                <input type="submit" id="submit" value="添加" class="btn btn-primary" />
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{include file='public/footer.html'}
<script>
    const GV = {
        upload_api: "{:url('api/upload')}",
        pic_upload_api: "{:url('api/upload_base64')}",
        pic_del_api: "{:url('api/image_del')}",
    }
</script>
<script src="__STATIC__/js/pic_upload.js?v={:site_ver()}"></script>
</body>
</html>